package com.lxw.report.meta.controller;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lxw.report.meta.contract.SysMenu.*;
import com.lxw.report.meta.entity.Menu;
import com.lxw.report.meta.service.ComplexService;
import com.lxw.report.meta.service.IMenuService;
import com.lxw.report.meta.vo.ResultVo;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


@Api(tags = "菜单管理")
@RestController
@RequestMapping ( "/menu" )
public class MenuController {

    @Autowired
    private IMenuService menuService;

    @Autowired
    private ComplexService complexService;

    @PostMapping("/listByUser")
    @ResponseBody
    public ResultVo<List<Menu>> getListByUser(HttpServletRequest request) {

        return ResultVo.success();
    }

    @PostMapping("/add")
    @ResponseBody
    public ResultVo add(HttpServletRequest request, @Validated SysMenuCreateRequest createRequest, BindingResult bindingResult) {
        return ResultVo.success();
    }

    @PostMapping("/edit")
    @ResponseBody
    public ResultVo edit(HttpServletRequest request, @Validated SysMenuUpdateRequest updateRequest, BindingResult bindingResult) {
        return ResultVo.success();
    }

    @PostMapping("/find")
    @ResponseBody
    public ResultVo<SysMenuFindResponse> find(SysMenuFindRequest findRequest) {
        return ResultVo.success();
    }

    @PostMapping("/delete")
    @ResponseBody
    public ResultVo delete(@Validated SysMenuDeleteRequest deleteRequest, BindingResult bindingResult) {
        return ResultVo.success();
    }
}